<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        window.onload = function(){
            let wBtn = document.getElementById("warn");
            wBtn.onclick = function(){
                alert("这是警告框...");
            }

            let cBtn = document.getElementById("confirm");
            cBtn.onclick = function(){
                confirm("这是确认框...");
            }

            let pBtn = document.getElementById("prompt");
            pBtn.onclick = function(){
                prompt("这是提示框...","提示框");
            }
        }
    </script>
</head>
<body>
    <button type="button" id="warn">警告框</button>
    <button type="button" id="confirm">确认框</button>
    <button type="button" id="prompt">提示框</button>
</body>
</html>